FROM ubuntu

COPY ./go-ethereum/ /go-ethereum
COPY ./bootnode-info/boot.key /

RUN echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" > /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
    apt-get update -y && \
    apt-get install -y build-essential golang && \
    chmod 777 -R /go-ethereum && \
    (cd /go-ethereum && make all) && \
    cp go-ethereum/build/bin/* / && \
    rm -rf /go-ethereum

CMD ["/bootnode","--nodekey=/boot.key"]
